package com.example.home_module;

import android.widget.ImageView;

import com.bumptech.glide.Glide;

import com.example.common.quick.BaseQuickAdapter;
import com.example.common.quick.BaseViewHolder;
import com.example.home_module.entity.VideoValuesEntity;
import com.example.imgload_sdk.GlideApp;
import com.example.imgload_sdk.ImgLoad;

import org.jetbrains.annotations.NotNull;

public class VideoAdapter extends BaseQuickAdapter<VideoValuesEntity> {

    public VideoAdapter() {
        super(R.layout.item_video);
    }

    @Override
    public void convert(BaseViewHolder holder, VideoValuesEntity item) {
        if(item.author.name==null){
            holder.setText(R.id.item_video_artist,"");
        }else {
            holder.setText(R.id.item_video_artist,item.author.name);
        }
        if(item.author.name==null){
            holder.setText(R.id.item_video_comment_artist,"");
        }else {
            holder.setText(R.id.item_video_comment_artist,item.author.name);
        }
        if (item.feeds_text==null){
            holder.setText(R.id.item_video_feeds_content,"");
        }else {
            holder.setText(R.id.item_video_feeds_content,item.feeds_text);
        }
        if (item.activityText==null){
            holder.setText(R.id.item_video_type,"");
        }else {
            holder.setText(R.id.item_video_type,item.activityText);
        }

        if (item.topComment==null){
            holder.setText(R.id.item_video_comment_content,"33333333");
        }else {
            holder.setText(R.id.item_video_comment_content,item.topComment.commentText);
        }
        holder.setText(R.id.item_video_count,item.author.historyCount+"");

        if (item.author.avatar==null){
            holder.errorImage(R.id.item_video_pic);
        }else {
            holder.setcrgImage(R.id.item_video_pic,item.author.avatar);
        }
        if (item.author.avatar==null){
            holder.errorImage(R.id.item_video_artist_img);
        }else {
            holder.setcrgImage(R.id.item_video_artist_img,item.author.avatar);
        }
        if (item.cover==null){
            holder.errorImage(R.id.item_video_bigimg);
        }else {
            holder.setImage(R.id.item_video_bigimg,item.cover);
        }





    }
}
